package com.vf.admin.client.dao;

import com.vf.admin.common.db.BaseDao;
import com.vf.admin.miaodong.entity.AlipayConfigs;
import com.vf.admin.miaodong.entity.AppOrder;
import com.vf.admin.utils.StringEx;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;


@Repository
public class AlipayConfigsDao extends BaseDao<AlipayConfigs> {

    /**
     * 查询所有
     */
    public List<AlipayConfigs> list() {
        ArrayList<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from alipay_configs where 1=1");
        sbStr.append(" and status = 1 ");
        String sql = sbStr.toString();
        return this.queryList(sql, paramList, AlipayConfigs.class);
    }

    public List<AlipayConfigs> isOpen() {
        ArrayList<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from alipay_configs");
        String sql = sbStr.toString();
        return this.queryList(sql, paramList, AlipayConfigs.class);
    }

    public AlipayConfigs getAppIdInfo(String appIdStr) {
        List<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from alipay_configs where appId = ?");
        paramList.add(appIdStr);
        String sql = sbStr.toString();
        return this.queryObj(sql, paramList, AlipayConfigs.class);
    }
}
